fix(dtc): fail loud on pre_interface_freeform when NDFC/ND lacks preInterfaceConfig - #839
Open
dacasti2mx wants to merge 1 commit into
Open
Conversation
…nterfaceConfig
The fabric freeform templates only emit preInterfaceConfig{Spine,Leaf,Tor}
(carrying *_pre_interface_freeform, e.g. a QoS policy-map that must exist before
an interface references it) when NDFC >= 12.2.2 and ND > 3.2.1. On older
versions that config was silently dropped while the dependent
intra_fabric_link_freeform (e.g. the QoS service-policy) was still pushed,
leaving the fabric permanently Out-of-Sync ('cannot apply non-existing policy').
- connectivity_check: set single-source fact 'preinterface_config_supported'
- freeform templates (iBGP + eBGP): gate preInterfaceConfig on that fact
- create role: fail loud when *_pre_interface_freeform is set but unsupported
(guard placed in create, not common, so remove/cleanup is never blocked)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue(s)
Fixes #838
Related Collection Role
Related Data Model Element
Proposed Changes
On NDFC < 12.2.2 / ND <= 3.2.1 the fabric freeform templates version-gate out
preInterfaceConfig{Spine,Leaf,Tor}, which carry*_pre_interface_freeform(for example aQoS policy-map). The dependent
intra_fabric_link_freeform(for example the QoSservice-policy that references that policy-map) is still pushed unconditionally. The switch
then rejects the orphan service-policy with "cannot apply non-existing policy to interface",
and the fabric stays Out-of-Sync with no clear error (see #838).
This change:
connectivity_check: adds a single-source factpreinterface_config_supported, computedonce where
nd_versionandndfc_versionare set (real boolean).preInterfaceConfig*on that fact instead of aduplicated inline version expression, so the two never drift.
createrole: fails loud with an actionable message when*_pre_interface_freeformis setbut the target version does not support it. The guard lives in
create(notcommon) soremove/cleanup is never blocked.Test Notes
Out-of-Sync (service-policy pending, no policy-map on the switch and in NDFC config-preview).
on supported versions or when no
*_pre_interface_freeformis set.preInterfaceConfigemitted(service-policy still emitted, behavior unchanged); supported ->
preInterfaceConfigpresent.preinterface_config_supportedverified to be a real boolean (not a "False" string).ansible-playbook --syntax-checkpasses.Cisco Nexus Dashboard Version
ND 3.1.1n (NDFC 12.2.1.316) for the failing case; supported path validated on ND 4.1.
Checklist